<template>
    <view class="m-login">
        <van-overlay  :show="show" :toShow="toShow" >
            <view class="wrapper">
                <view class="block" catch:tap="noop">
                    <view class="tipsImgbox"><image class="tipsImg" src="../static/img/tipsImg.png"/></view>
                    <view class="b-title-one">
                       {{message}}
                    </view>
                    <view class="sure" @tap="handleSure($event)" :data-url="url" :data-query="query">
                        确定
                    </view>
                </view>
            </view>
        </van-overlay>
    </view>
</template>


<script>
    export default{
        name:"m-tips",
        props: {
            toShow: {
                type: Boolean,
                default: false
            },
            url: {
                type: String,
                default:''
            },
            message: {
                type: String,
                default:''
            },
            query: {
                type: String,
                default:''
            },
            },
        computed: {},
        watch: {
            toShow(newValue, oldValue) {
                this.show = newValue;
            }
        },
        data(){
            return{
                // toShow:false,
                show:false
            }
        },
        methods:{
            onClickShow() {
                this.show=true
                console.log(this.show)
            },
            onClickHide(){
                this.show=false
            },
            handleSure(event){
                this.show = false;
                this.$emit('sure',this.show);
            }
        },

    }
</script>

<style lang="less" scoped>
    .m-login{
        .wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }

        .block {
            width: 600rpx;
            height: 300rpx;
            border-radius: 10px;
            background-color: #fff;
            .b-title-one{
                font-size: 30rpx;
                color: #333333;
                text-align: center;
                line-height: 75rpx;
                overflow: hidden;
                text-overflow:ellipsis;
                white-space: nowrap;
            }
        }
    }
    .tipsImg{
        width: 90rpx;
        height: 90rpx;
    }
    .tipsImgbox{
        margin-top: 40rpx;
        text-align: center;
    }
    .sure{
        text-align: center;
        font-size: 40rpx;
        color: #FF9502;
        width: 90%;
        margin-left: 5%;
        line-height: 2;
        border-top: solid 0.5px #D2D3D5;
    }
</style>
